package com.bw.zg3park2212.user

import androidx.lifecycle.lifecycleScope
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter
import com.blankj.utilcode.util.SPUtils
import com.bw.base.mvvm.BaseViewActivity
import com.bw.zg3park2212.databinding.ActivitySplashBinding
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch


@Route(path = "/app/SplashActivity")
@AndroidEntryPoint
class SplashActivity : BaseViewActivity<ActivitySplashBinding>() {
    override fun intitView() {
        lifecycleScope.launch {
            for (i in 5 downTo 0){
                delay(1000)
                binding.djs.text=""+i+"S"
            }
            SPUtils.getInstance().put("isin","123")
            ARouter.getInstance().build( "/app/LoginActivity").navigation()
            finish()
        }
        binding.djs.setOnClickListener {
            SPUtils.getInstance().put("isin","123")
            ARouter.getInstance().build( "/app/LoginActivity").navigation()
            finish()
        }
        if (SPUtils.getInstance().getString("isin").isNotEmpty()){
            ARouter.getInstance().build( "/app/LoginActivity").navigation()
            finish()
        }
    }

    override fun intitData() {

    }

}